import request from './request'

// 新增规则
export const componentRuleAdd = (componentRule) => {
  return request({
    url: '/componentRule/add',
    method: 'post',
    data: componentRule,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 修改规则
export const componentRuleUpdate = (componentRule) => {
  return request({
    url: '/componentRule/update',
    method: 'post',
    data: componentRule,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 规则详情
export const componentRuleDetail = (componentId) => {
  return request({
    url: '/componentRule/detail',
    method: 'get',
    param: { componentId },
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 删除规则
export const componentRuleDelete = (componentId) => {
  return request({
    url: '/componentRule/delete',
    method: 'get',
    param: { componentId },
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}
